export const opt = {
  warehouse: [
    {
      label: "自营仓",
      value: 1,
    },
    {
      label: "亚马逊仓",
      value: 2,
    },
    {
      label: "海外仓",
      value: 3,
    },
    {
      label: "海外中转仓",
      value: 4,
    },
  ],
  status: [
    { label: "启用", value: 1 },
    { label: "禁用", value: 0 },
  ],
};
//递归调用
export const treeToArray = tree => {
  let arr = [];
  const expanded = datas => {
    if (datas && datas.length > 0) {
      datas.forEach(e => {
        if (!e.p_id) {
          e.p_id = null
        }
        arr.push(e);
        expanded(e.son);
      })
    }
  };
  expanded(tree);
  return arr;
}

export const propsCascader = {
  children: 'sub', label: 'name', value: 'id', checkStrictly: true, emitPath: false
}
